﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

using XEvent.Interface;
using XEvent.Ioc;

namespace XEvent
{
    public abstract class XApplicationBase : Application
    {
        private IXContainer _container;

        public IXContainer Container => _container;

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            InitializeInternal();
        }

        private void InitializeInternal()
        {
            Initialize();
        }

        private void Initialize()
        {
            _container = XContainerLocator.Instance;
            RegisterTypes(_container);
        }

        public abstract void RegisterTypes(IXContainer container);
    }
}
